
#ClassWork.py

name = input("Please input your name:")
print("Python Welcome:"+ name)

float_a = float(input("请输入浮点数a:"))
float_b = float(input("请输入浮点数b:"))
print("平均值:{}".format((float_a+float_b)/2))

a = input("请输入10进制:")
print(a)
a = input("请输入2进制:")
print(int(a,2))
a = input("请输入8进制:")
print(int(a,8))
a = input("请输入16进制:")
print(int(a,16))

print("100-0o:{}".format(oct(100)))
print("100-0x:{}".format(hex(100)))

a = eval(input("请输入数字a:"))
b = eval(input("请输入数字b:"))
print("加法:",a+b)
print("减法:",a-b)
print("除法:",a/b)
print("乘法:",a*b)
print("取余",a%b)
print("求商",a//b)
print("幂次",a**b)
print("商余函数",divmod(a,b))
print("幂次函数",pow(a,b))

letters = "abcdefghijklmnopqrstuvwxyz"
print(letters[-6:-2])
print(letters[-3:])
print(letters[-2:-6])
print(letters[1:5:2])
print(letters[::7])
print(letters[::-1])

import math
from math import *
print(math.pi)
print(math.e)
a = int(input("请输入a:"))
b = int(input("请输入b:"))
x = int(input("请输入x:"))
print(math.gcd(a,b))
print(math.factorial(x))
print(math.exp(x))
print(math.log2(x))
print(math.sqrt(x))